package com.zqxq.lottery.mapper.sys;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.zqxq.lottery.entity.po.sys.SysAnalyzePO;
import com.zqxq.lottery.entity.vo.sys.ChannelDataExportVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author 苦智
 * @date 2018/4/9 14:35
 * @description 数据统计
 * @ClassName SysAnalyzeMapper
 */
@Component(value = "sysAnalyzeMapper")
public interface SysAnalyzeMapper extends BaseMapper<SysAnalyzePO>{
    Map<String,Object> getTotalCount(@Param("startTime") String startTime,@Param("endTime") String endTime);

    List<String> getAllDate(@Param("startTime") String startTime,@Param("endTime") String endTime);

    List<Map<String,Object>> getKLineCount(@Param("startTime") String startTime,@Param("endTime") String endTime);

    Map<String,Object> getKLineDataByDate(@Param("date") String date);

    //渠道统计
    List<Map<String,Object>> getChannelCount(Page<Map<String, Object>> page, Map<String, Object> paramMap);

    Map<String,Object> getChannelTotal(Map<String, Object> paramMap);

    Map<String,Object> getChannelTotalCount();

    //获取所有渠道
    @Select("SELECT DISTINCT channel FROM user_info where channel is not null and channel <> ''")
    List<String> getAllChannel();

    Map<String,Object> getMerchantTotalCount();

    List<Map<String,Object>> getMerchantUserOrder(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("lotteryId") Long lotteryId,@Param("status") Long status,Page<Map<String,Object>> page);

    List<Map<String,Object>> getMerchantUserOrderBet(@Param("lotteryId") Long lotteryId,@Param("orderId") String orderId);

    void merchchantConfirmTicket(@Param("orderId") Long orderId);

    List<Map<String, Object>> getWinPrizeData(Map<String, Object> paramMap);

    Integer getBetCount(@Param("groupTime") String groupTime,@Param("lotteryId") String lotteryId);

    List<Map<String,Object>> getAgentDataStatistics(Page<Map<String, Object>> page, Map<String, Object> paramMap);

    List<ChannelDataExportVo> getchannelCountList(Map<String, Object> paramMap);

    Map<String,Object> getTotalProfitCount(@Param("startTime") String startTime,@Param("endTime") String endTime);

    Map<String,Object> getEachCount();

    List<Map<String,Object>> getDataProfitCount(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("timeType") Integer timeType);

    Map<String,Object> saleFunnelCountTotal(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("client") Integer client);

    List<Map<String,Object>> getSaleFunnelCountList(Page page, @Param("startTime") String startTime, @Param("endTime") String endTime,
                                                    @Param("timeType") Integer timeType, @Param("client") Integer client);

    List<String> getUserActivityAllDate(@Param("startTime") String startTime,@Param("endTime") String endTime);
    Map<String,Object> getUserActivityAnalysis(@Param("startTime") String startTime,@Param("endTime") String endTime);

    Map<String,Object> getUserActivityKLine(@Param("date") String date,@Param("source") Integer source);

    List<String> pageDate(Page page,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("timeType") Integer timeType);
    //获取资金统计折线图的所有日期
    List<String> getAllCashDate(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("timeType") Integer timeType);

    Map<String, Object> getCashCountByDate(@Param("date") String date,@Param("timeType") Integer timeType);

    Map<String,Object> getUserActivityPage(@Param("date") String date,@Param("timeType") Integer timeType,@Param("source") Integer source);

    Integer getReOrderUserByDate(@Param("date") String date);

    Map<String,Object> getSaleFunnelByDate(@Param("date") String date, @Param("client") Integer client,@Param("timeType") Integer timeType);

    BigDecimal productPerformanceTotal(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("gameType") Integer gameType);

    List<Map<String, Object>> productPerformanceTotal10(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("gameType") Integer gameType);

    List<Map<String, Object>> getDataRepresent(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("gameType") Integer gameType);

    List<Map<String, Object>> getDataRepresent10(@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("gameType") Integer gameType);

    Map<String, Object> getdateGroup21(@Param("time") String time);

    Map<String, Object> getdateGroup24(@Param("time") String time);

    List<Map<String, Object>> getdateGroup10(@Param("time") String time);
}
